package com.ruoyi.gateway.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 设备连接状态对象 iot_device_connection_status
 *
 * @author 白向阳
 * @date 2025-09-28
 */
public class DeviceConnectionStatus extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** $column.columnComment */
    private Long id;

    /** 客户端设备ID */
    @Excel(name = "客户端设备ID")
    private String clientClientId;

    /** 子设备索引 */
    @Excel(name = "子设备索引")
    private String clientDeviceIndex;

    /** 平台客户端ID */
    @Excel(name = "平台客户端ID")
    private String platformClientId;

    /** 连接状态：0-离线，1-在线 */
    @Excel(name = "连接状态：0-离线，1-在线")
    private Long connectionStatus;

    /** 最后连接时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "最后连接时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date lastConnectTime;

    /** 最后断开时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "最后断开时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date lastDisconnectTime;

    /** 上行消息数量 */
    @Excel(name = "上行消息数量")
    private Long messageCountUp;

    /** 下行消息数量 */
    @Excel(name = "下行消息数量")
    private Long messageCountDown;

    /** 最后消息时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "最后消息时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date lastMessageTime;

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }

    public void setClientClientId(String clientClientId)
    {
        this.clientClientId = clientClientId;
    }

    public String getClientClientId()
    {
        return clientClientId;
    }

    public void setClientDeviceIndex(String clientDeviceIndex)
    {
        this.clientDeviceIndex = clientDeviceIndex;
    }

    public String getClientDeviceIndex()
    {
        return clientDeviceIndex;
    }

    public void setPlatformClientId(String platformClientId)
    {
        this.platformClientId = platformClientId;
    }

    public String getPlatformClientId()
    {
        return platformClientId;
    }

    public void setConnectionStatus(Long connectionStatus)
    {
        this.connectionStatus = connectionStatus;
    }

    public Long getConnectionStatus()
    {
        return connectionStatus;
    }

    public void setLastConnectTime(Date lastConnectTime)
    {
        this.lastConnectTime = lastConnectTime;
    }

    public Date getLastConnectTime()
    {
        return lastConnectTime;
    }

    public void setLastDisconnectTime(Date lastDisconnectTime)
    {
        this.lastDisconnectTime = lastDisconnectTime;
    }

    public Date getLastDisconnectTime()
    {
        return lastDisconnectTime;
    }

    public void setMessageCountUp(Long messageCountUp)
    {
        this.messageCountUp = messageCountUp;
    }

    public Long getMessageCountUp()
    {
        return messageCountUp;
    }

    public void setMessageCountDown(Long messageCountDown)
    {
        this.messageCountDown = messageCountDown;
    }

    public Long getMessageCountDown()
    {
        return messageCountDown;
    }

    public void setLastMessageTime(Date lastMessageTime)
    {
        this.lastMessageTime = lastMessageTime;
    }

    public Date getLastMessageTime()
    {
        return lastMessageTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("clientClientId", getClientClientId())
            .append("clientDeviceIndex", getClientDeviceIndex())
            .append("platformClientId", getPlatformClientId())
            .append("connectionStatus", getConnectionStatus())
            .append("lastConnectTime", getLastConnectTime())
            .append("lastDisconnectTime", getLastDisconnectTime())
            .append("messageCountUp", getMessageCountUp())
            .append("messageCountDown", getMessageCountDown())
            .append("lastMessageTime", getLastMessageTime())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
